< previous page page_585 next page >

Page 585
Chapter 17
Ray Tracing
The previous chapters describe methods for displaying three-dimensional objects that have grown increasingly realistic. At the same time, they have grown more complex. Chapter 13, Three-Dimensional Transformations, starts the discussion of three-dimensional objects by describing transformations in three-dimensions. Using translation, rotation, and projection transformations, you can write programs to display three-dimensional objects like the sphere shown in Figure 17.1.
Chapter 14, Surfaces, describes different ways to manage and display three-dimensional surfaces. This chapter explained the Hi-Lo and Z-Order algorithms that allow you to remove the hidden parts of a three-dimensional surface.
Chapter 15, Hidden Surface Removal, describes more general hidden surface removal techniques like backface removal and the Depth-Sort algorithm. By removing hidden surfaces, you can reduce the clutter in an image and make it easier to understand. Figure 17.2 shows a sphere similar to the one shown in Figure 17.1 with the hidden surfaces removed. While these algorithms provide a greater degree of realism, they are also fairly complex, requiring code to handle many special cases.
Chapter 16, Shading Models, improves the hidden surface methods by shading the surfaces that make up three-dimensional solids. Shading provides visual clues about the depth and surface features of three-dimensional objects, making them appear more realistic and easier to understand. Figure 17.3 shows a sphere similar to those in Figures 17.1 and 17.2 with shading added.
The shading model described in Chapter 16 takes into account ambient light, diffuse and specular reflection, and distance effects. Gouraud and Phong shading produce smoothly shaded surfaces, though the code is time consuming and complex. You can also extend the shading models used to handle transparency and shadows, but these extensions are quite complicated.
In some sense, ray tracing is a generalization of the lighting models described in Chapter 16. By following light rays, ray tracing lets you model complex interactions between light and the objects in a scene. Using a single elegant algorithm, ray tracing handles:

 
< previous page page_585 next page >